Skip to main content

mobilePlaySoundOnChannel

Type

command

Summary

Plays a sound on a given channel.

Syntax

mobilePlaySoundOnChannel <sound>, <channel>, <type>

Description

Use the mobilePlaySoundOnChannel command to play a sound on a given channel.

If a sound channel with the given name doesn't exist a new one is created. When queuing a sound using next, the engine will 'pre-prepare' the sound long before the current sound is played, this ensures minimal latency between the current sound ending and the next one beginning.

If an empty string is passed as the sound parameter, the current and scheduled sound on the given channel will be stopped and cleared.

When the sound has finished playing naturally (not stopped/replaced) on a given channel, a soundFinishedOnChannel message is sent to the object which played the sound.

Parameters

NameTypeDescription

sound

The sound file to be played.

channel

The name of the channel to play the sound on.

type

enum

Examples

mobilePlaySoundOnChannel theSound, theChannel, theType
mobilePlaySoundOnChannel "sounds/warning.mp4", "queued", "next"
put specialFolderPath("engine") & "/sounds/applause.mp4" into tSoundFile
mobilePlaySoundOnChannel tSoundFile, "current", "now"

command: mobileDeleteSoundChannel, mobilePlaySoundOnChannel, mobileSetSoundChannelVolume, mobilePausePlayingOnChannel, mobileStopPlayingOnChannel, mobileResumePlayingOnChannel, iphoneSetAudioCategory

function: mobileSoundChannelVolume, mobileSoundOnChannel, mobileNextSoundOnChannel, mobileSoundChannels, mobileSoundChannelStatus

message: soundFinishedOnChannel

Compatibility and Support

Introduced

LiveCode 4.6

OS

ios

android

Platforms

mobile

Thank you for your feedback!

Was this page helpful?